<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePublishersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('publishers', function (Blueprint $table) {
            $table->integer('user_id');
            $table->decimal('total_money')->default(0.00)->comment('总金额');
            $table->decimal('available_money')->default(0.00)->comment('可用金额');
            $table->decimal('freeze_money')->default(0.00)->comment('冻结金额');
            $table->tinyInteger('status')->default(0)->comment('状态:1有效,0无效');
            $table->timestamps();
            $table->primary('user_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('publishers');
    }
}
